import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/index',
    children: [
      /*-----------前台首页（总）-----------*/
      {
        path: '/index',
        component: () => import(/* webpackChunkName: "about" */ '../views/FrontIndex')
      },
      /*-----------商城板块-----------*/
      /*商城主页*/
      {
        path: '/mall/index',
        component: () => import(/* webpackChunkName: "about" */ '../views/stx-mall/stx-mall-index.vue')
      },
      /*商城详情页*/
      {
        path: '/mall/detail',
        component: () => import(/* webpackChunkName: "about" */ '../views/stx-mall/stx-mall-detail.vue')
      },
      /*商城购物车*/
      {
        path: '/mall/cart',
        component: () => import(/* webpackChunkName: "about" */ '../views/stx-mall/stx-mall-cart.vue')
      },
      /*商城订单页*/
      {
        path: '/mall/order',
        component: () => import(/* webpackChunkName: "about" */ '../views/stx-mall/stx-mall-order.vue')
      },
      /*商城搜索页*/
      {
        path: '/mall/search',
        component: () => import(/* webpackChunkName: "about" */ '../views/stx-mall/stx-mall-search.vue')
      },
      /*-----------健身板块-----------*/
      /**/
      {
        path: '/fitness/index',
        component: () => import(/* webpackChunkName: "about" */ '../views/stx-fitness/stx-fitness-index')
      },



    ]

  },
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView.vue')
  },
  {
    path: '/main',
    component: () => import(/* webpackChunkName: "about" */ '../views/MainView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
